package cn.tedu._01mvcboot01.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class UserController {
    /*@RequestMapping根据请求的url地址映射到具体的控制器方法
    * @ResponseBody响应注解，允许控制器方法以返回值的形式返回g给*/

    @RequestMapping("/v1/user/login")
    @ResponseBody
    public String login(){
        return "恭喜你，登录成功";
    }
    /*增加注册功能：
    * 1、get请求，https://localhost:8088/v1/user/reg?username=lucy&password=123456
    * */
    @RequestMapping("/v1/user/reg")
    @ResponseBody
    public String reg(String username,String password){
        return username+","+password;
    }
}
